home *** CD-ROM | disk | FTP | other *** search
/ 130 MIDI Tool Box / 130 MIDI Tool Box.iso / midimod1 / midimod.h < prev    next >
Text File  |  1993-04-12  |  5KB  |  186 lines

  1. /*
  2.  * MIDIMOD.H - Amiga Module to MIDI file converter header
  3.  * Turbo C 2.0
  4.  *
  5.  * Author: Andrew Scott (Adrenalin Software)
  6.  *
  7.  * Date: 14/3/1993 ver 0.1
  8.  */
  9.  
  10. /* File buffer size.. increase for better performance */
  11. #define BUFFSIZE 512
  12.  
  13. /* Max line length in text files */
  14. #define MAXSTRING 128
  15.  
  16. /* MIDI drum channel - 1 */
  17. #define DRUMCHANN 9
  18.  
  19. /* MIDI instrument file */
  20. #define DEF_INSFILE "midimod.ins"
  21.  
  22. /* MOD sample to MIDI instrument map */
  23. #define DEF_MAPFILE "midimod.map"
  24.  
  25. typedef char *string;
  26.  
  27. typedef struct bstruct {
  28.     FILE *f;                   /* File to read/write to */
  29.     unsigned char b[BUFFSIZE]; /* Holds buffer data */
  30.     unsigned int o, r;         /* Offset in buffer, Bytes actually read */
  31. } bfile[1];
  32.  
  33. struct bpos {
  34.     struct bstruct d; /* file data */
  35.     unsigned long p;  /* file position */
  36. };
  37.  
  38. typedef struct _X3 {
  39.     char n[23];         /* Sample name */
  40.     unsigned int l;     /* Number of ticks in length (4000 per second) */
  41.     unsigned char v, m; /* Volume of sample, Midi instrument */
  42.     signed char c;      /* Midi channel */
  43.     int t[3];           /* Transposition amounts */
  44. } samp;
  45.  
  46. typedef struct _X4 {
  47.     unsigned char n; /* Number of samples */
  48.     samp s[31];      /* Sample information */
  49. } samps[1];
  50.  
  51. string _IF[] = {
  52.   "Please enter the filename for the",
  53.     "",
  54.     "",
  55.     NULL
  56. };
  57.  
  58. string _CNVE[] = {
  59.     "Conversion Error:",
  60.     "",
  61.     "Both the MIDI and MOD files must be defined",
  62.     "before conversion can take place.",
  63.     NULL
  64. };
  65.  
  66. string _MODE[] = {
  67.     "Amiga Module Error:",
  68.     "",
  69.     "The MOD file you have chosen cannot be",
  70.     "understood by this program.",
  71.     NULL
  72. };
  73.  
  74. string _NOFIL[] = {
  75.     "File Error:",
  76.     "",
  77.     "Cannot locate the file",
  78.     "",
  79.     NULL
  80. };
  81.  
  82. string _MODM[] = {
  83.     "Amiga Module Error:",
  84.     "",
  85.     "There has been no MOD file defined yet, so",
  86.     "no samples have been loaded.",
  87.     NULL
  88. };
  89.  
  90. string _OOME[] = {
  91.     "Out Of Memory Error:",
  92.     "",
  93.     "For some reason, all of the available memory",
  94.     "has been allocated, and this program cannot",
  95.     "continue.",
  96.     NULL
  97. };
  98.  
  99. string _OUTE[] = {
  100.     "Warning:",
  101.     "",
  102.     "You have chosen a file which already exists.",
  103.     "Proceeding will overwrite this file. Press ",
  104.     "the letter 'Y' if this is ok.",
  105.     NULL
  106. };
  107.  
  108. string _TMC[] = {
  109.     "Instrument Error:",
  110.     "",
  111.     "You have selected too many different instruments.",
  112.     "There is a maximum of 16 different instruments, ",
  113.     "including 1 drum instrument. Please change your ",
  114.     "selection.",
  115.     NULL
  116. };
  117.  
  118. string _NOSAV[] = {
  119.     "File Access Error:",
  120.     "",
  121.     "The file " DEF_MAPFILE " cannot be replaced with",
  122.     "an updated version. Any changes to the instrument-maps",
  123.     "cannot be performed. Please exit from the program and",
  124.     "set up the necessary access permissions on this file if",
  125.     "you wish to use this command.",
  126.     NULL
  127. };
  128.  
  129. string _ABOUT[] = {
  130.     "MIDIMOD ver 0.1 (c) Andrew Scott (Adrenalin Software) '93",
  131.     "",
  132.     "MIDIMOD is a utility that aids in the conversion of .MOD",
  133.     "files (Amiga Sound/Noise/Protracker files) to MIDI files",
  134.     "(General MIDI format 1 files). Many effects are converted",
  135.     "but some cannot due to the differences between the two",
  136.     "formats. A log of instrument-maps can be kept and updated",
  137.     "to allow MIDIMOD to automatically allocate instruments &",
  138.     "transpositions to known samples.",
  139.     "",
  140.     "Note: Some editting may be necessary after conversion due",
  141.     "to the lack of information stored in the .MOD file. Also,",
  142.     "MIDI players without tempo-track interpretting may not",
  143.     "play the converted MIDI file properly.",
  144.     NULL
  145. };
  146.  
  147. string _TRAQ[] = {
  148.     "Please enter a transposition value",
  149.     "for the sample you have just selected,",
  150.     "eg. '-12' for a bass guitar sample,",
  151.     "'0,3,7' for a minor chord, or '0,4,7'",
  152.     "for a major chord are usual.",
  153.     "",
  154.     NULL
  155. };
  156.  
  157. string _TRANE[] = {
  158.     "Transposition Error:",
  159.     "",
  160.     "You cannot set transposition values outside",
  161.     "the range -128 to 127. Much smaller values",
  162.     "are usual anyway. Your transposition is being",
  163.     "reset back to 0.",
  164.     NULL
  165. };
  166.  
  167. string _TRANWRN[] = {
  168.     "Transposition Warning:",
  169.     "",
  170.     "You have set transposition values for a percussion",
  171.     "instrument. This is not a good idea unless you know",
  172.     "what you are doing - effectively changing the",
  173.     "percussion instrument! The rest of the program can't",
  174.     "report correct information if you do this. Chords",
  175.     "are also not really possible for percussion. You",
  176.     "would be sensible to change the values to 0.",
  177.     NULL
  178. };
  179.  
  180. string _CNVPOS[] = {
  181.     "Please wait..",
  182.     "Currently converting",
  183.     "sample    ",
  184.     NULL
  185. };
  186.